package cn.hznc.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author：Administrator
 * @Date：2023/4/6 11:14
 */
@Getter
@Setter
@Table(name = "t_tool_part")
@TableName(value = "t_tool_part")
public class ToolPartEntity{

    /**
     * 主键
     */
    @Column(name = "id",type = MySqlTypeConstant.INT,length = 11,isKey = true,isAutoIncrement = true)
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 工件图片
     */
    @Column(name = "image", type = MySqlTypeConstant.VARCHAR, length = 500)
    @TableField(value = "image")
    private String image;

    /**
     * 工件类型
     */
    @Column(name = "tool_type", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "tool_type")
    private String toolType;

    /**
     * 工件类型
     */
    @Column(name = "tool_no", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "tool_no")
    private String toolNo;

    /**
     * 刀具编号
     */
    @Column(name = "idnr", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "idnr")
    private String idnr;

    /**
     * 物料编码
     */
    @Column(name = "partno", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "partno")
    private String partno;


    /**
     * 标识
     */
    @Column(name = "label", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "label")
    private String label;

    /**
     * 唯一id
     */
    @Column(name = "unique_id", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "unique_id")
    private String uniqueId;

    /**
     * 寿命
     */
    @Column(name = "life", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "life")
    private String life;

    /**
     * 剩余寿命
     */
    @Column(name = "remaining_life", type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField(value = "remaining_life")
    private String remainingLife;

    /**
     * 是否报废
     */
    @Column(name = "is_damage", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "is_damage")
    private Integer isDamage;

    /**
     * 是否组装
     */
    @Column(name = "is_assembled", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "is_assembled")
    private Integer isAssembled;

    /**
     * 报废时间
     */
    @Column(name = "damage_time", type = MySqlTypeConstant.DATETIME)
    @TableField(value = "damage_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date damageTime;

    /**
     * 库存记录id
     */
    @Column(name = "inventory_location_id", type = MySqlTypeConstant.INT, length = 11)
    @TableField(value = "inventory_location_id")
    private Integer inventoryLocationId;

    /**
     * 库存记录id
     */
    @Column(name = "params", type = MySqlTypeConstant.TEXT)
    @TableField(value = "params")
    private String params;

    /**
     *
     */
    @Column(name = "assembly_tool_unique_id", type = MySqlTypeConstant.VARCHAR)
    @TableField(value = "assembly_tool_unique_id")
    private String assemblyToolUniqueId;

    /**
     * 装配日志
     */
    @Column(name = "status", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "status")
    private Integer status;

    /**
     * 装配日志
     */
    @Column(name = "log", type = MySqlTypeConstant.TEXT)
    @TableField(value = "log")
    private String log;

    /**
     * 装配日志
     */
    @Column(name = "assembly_unique_id_history", type = MySqlTypeConstant.TEXT)
    @TableField(value = "assembly_unique_id_history")
    private String assemblyUniqueIdHistory;


    /**
     * 使用时间
     */
    @Column(name = "time_usage", type = MySqlTypeConstant.VARCHAR)
    @TableField(value = "time_usage")
    private String timeUsage;

    /**
     * 半径
     */
    @Column(name = "oal", type = MySqlTypeConstant.DECIMAL)
    @TableField(value = "oal")
    private BigDecimal oal;

    /**
     * 长度
     */
    @Column(name = "length", type = MySqlTypeConstant.DECIMAL)
    @TableField(value = "length")
    private BigDecimal length;

    /**
     * 长度
     */
    @Column(name = "damage_log", type = MySqlTypeConstant.TEXT)
    @TableField(value = "damage_log")
    private String damageLog;


    /**
     * 类型标记
     */
    @Column(name = "type_flag", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "type_flag")
    private Integer typeFlag;

    /**
     * 类型标记
     */
    @Column(name = "backup_status", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "backup_status")
    private Integer backupStatus;

    /**
     * 类型标记
     */
    @Column(name = "backup_machine_tool_task_id", type = MySqlTypeConstant.INT , length = 11)
    @TableField(value = "backup_machine_tool_task_id")
    private Integer backupMachineToolTaskId;

    /**
     * 类型标记
     */
    @Column(name = "radius", type = MySqlTypeConstant.VARCHAR , length = 100)
    @TableField(value = "radius")
    private String radius;

    @Column(name = "subprogram_name", type = MySqlTypeConstant.VARCHAR , length = 200)
    @TableField(value = "subprogram_name")
    private String subprogramName;

    /**
     * 类型标记
     */
    @Column(name = "tool_length", type = MySqlTypeConstant.VARCHAR , length = 100)
    @TableField(value = "tool_length")
    private String toolLength;


    /**
     * 类型标记
     */
    @Column(name = "remaining_life_rate", type = MySqlTypeConstant.INT , length = 5)
    @TableField(value = "remaining_life_rate")
    private Long remainingLifeRate;

    /**
     * 类型标记
     */
    @Column(name = "codeScanner_flag", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "codeScanner_flag")
    private Integer codeScannerFlag;

    /**
     * 类型标记
     */
    @Column(name = "selected_flag", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "selected_flag")
    private Integer selectedFlag;

    /**
     * 绑定任务id(被占用任务id)
     */
    @Column(name = "selected_task_id", type = MySqlTypeConstant.INT , length = 11)
    @TableField(value = "selected_task_id")
    private Integer selectedTaskId;

    /**
     * 绑定占用任务分组id(被占用任务分组id)
     */
    @Column(name = "select_group_id", type = MySqlTypeConstant.VARCHAR , length = 200)
    @TableField(value = "select_group_id")
    private String selectGroupId;

    /**
     * 绑定任务id(被占用任务id)
     */
    @Column(name = "data_log", type = MySqlTypeConstant.LONGTEXT)
    @TableField(value = "data_log")
    private String dataLog;

    /**
     * 绑定任务id(被占用任务id)
     */
    @Column(name = "summation_time", type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField(value = "summation_time")
    private String summationTime;

    /**
     * 绑定任务id(被占用任务id)
     */
    @Column(name = "tool_part_flag", type = MySqlTypeConstant.TINYINT)
    @TableField(value = "tool_part_flag")
    private Integer toolPartFlag;

    /**
     * 额外字段（刀柄rfid）
     */
    @TableField(exist = false)
    private String shankRfid;


    /**
     * 任务描述
     */
    @TableField(exist = false)
    private String machineTaskName;

    @TableField(exist = false)
    private String warehouseName;

    @TableField(exist = false)
    private String groupId;

    @TableField(exist = false)
    private String warehouseType;

}
